//
//  ShouchangCollectionViewCell.m
//  GOGOTravel
//
//  Created by dllo on 16/3/1.
//  Copyright © 2016年 果果. All rights reserved.
//

#import "ShouchangCollectionViewCell.h"

@implementation ShouchangCollectionViewCell


- (void)dealloc{
    [_image1 release];
    [_image2 release];
    
    [_label1 release];
    [_label2 release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.image1 = [[UIImageView alloc] init];
        [self.contentView addSubview:_image1];
        [_image1 release];
        
        self.image2 = [[UIImageView alloc] init];
        [self.contentView addSubview: _image2];
        [_image2 release];
        
        self.label1 = [[UILabel alloc] init];
        [self.contentView addSubview:_label1];
        [_label1 release];
        
        
        self.label2 = [[UILabel alloc] init];
        [self.contentView addSubview:_label2];
        [_label2 release];
        
        
        
        
        
        
        
    }
    return self;
}

- (void)setModel:(ShouChangModel *)model{
    
    if (_model != model) {
        [_model release];
        _model = [model retain];
        
    }
    _image1.frame = CGRectMake(0, 0, self.frame.size.width, 150);
    
    _label1.frame = CGRectMake(10, 155, self.frame.size.width - 20, 50);
    _label1.font = [UIFont systemFontOfSize:12];
    _label1.numberOfLines = 2;
    
    _image2.frame = CGRectMake(10, 210, 34, 34);
    _image2.layer.cornerRadius = 17;
    _image2.layer.masksToBounds = YES;
    
    _label2.frame = CGRectMake(55, 220, 80, 20);
    _label2.font = [UIFont systemFontOfSize:10];
    
    
    [self setValues];
    
    
    
}


- (void)setValues{
    
    
    
    [_image1 sd_setImageWithURL:[NSURL URLWithString:_model.backImageStr] placeholderImage:[UIImage imageNamed:PLACE_HLODER]];
    _label1.text = _model.titleLabelStr;
    
    
    [_image2 sd_setImageWithURL:[NSURL URLWithString:_model.hearderImageStr] placeholderImage:[UIImage imageNamed:PLACE_HLODER]];
    
    _label2.text = _model.nameLabelStr;
    
}


@end
